using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;

namespace JBORPG.Server
{
    public class DatabaseConnection
    {
        private SqlConnection m_Connection;
        private SqlDataReader m_Reader;

        public DatabaseConnection(String connectionString)
        {
            m_Connection = new SqlConnection(connectionString);
            m_Connection.Open();
        }

        public Boolean ReaderIsFree
        {
            get
            {
                if (m_Reader == null || m_Reader.IsClosed)
                    return true;
                else
                    return false;
            }
        }

        public SqlConnection Connection
        {
            get
            {
                return m_Connection;
            }
        }

        public SqlDataReader Reader
        {
            get
            {
                return m_Reader;
            }
            set
            {
                m_Reader = value;
            }
        }
    }
}
